<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    
</body>
<script>;
    let p1 = new Promise((res,rej)=>{
        let time = setTimeout(function(){
            let a = 0;
            res(a)
        },1000)  
    })
    let p2 = new Promise(res => {
        let time  = setTimeout(function(){
            let b = 1
            res(b)
        })
    },2000)
    Promise.all([p1,p2]).then(data=>{
        console.log(data)
    },err=>{
        console.log(err)
    })
    // Promise.race([p1,p2]).then(data=>{
    //     console.log(data)
    // },err=>{
    //     console.log(err)
    // })
</script>
</html>